package com.bothin.experiment4.dao;

import com.bothin.experiment4.model.ContactDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ContactDetailMapper extends Mapper<ContactDetail> {
    @Select("SELECT print_status printStatus FROM `contact_detail` \n" +
            "WHERE contact_id = #{contactId}")
    public List<Integer> findAllPrintStatusByContactId(String contactId);

    @Select("SELECT product_id productId FROM `contact_detail` \n" +
            "WHERE contact_id = #{contactId}")
    public List<String> findAllProductIdByContactId(String contactId);

    @Delete("DELETE FROM contact_detail\n" +
            "WHERE contact_detail.product_id = #{productId}")
    public void deleteByProductId(String productId);
}